{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "94b59237",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import yfinance as yf\n",
    "from utils import plot_returns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "713bdf1f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Download S&P 500 front month futures data\n",
    "prices = yf.download(['ES=F', 'ZN=F'])[\"Adj Close\"].resample(\"M\").last()\n",
    "# Calculate logarithmic returns\n",
    "log_returns = np.log(prices).diff()\n",
    "# Set portfolio weights\n",
    "# YOUR CODE HERE\n",
    "weights = None\n",
    "# Calculate weighted returns\n",
    "# YOUR CODE HERE\n",
    "weighted_returns = None\n",
    "# YOUR CODE HERE\n",
    "# Calculate portfolio returns\n",
    "portfolio_returns = None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "122b8764",
   "metadata": {},
   "outputs": [],
   "source": [
    "plot_returns(portfolio_returns)"
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "main_language": "python",
   "notebook_metadata_filter": "-all"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
